﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FluentValidation.Mvc;
using Home.Domain.Entities;
using Home.WebUI.Areas.Example.Models.Validation;

namespace Home.WebUI.Areas.Example.Controllers
{
    public class UserInfoController : Controller
    {
        private EFDbContext db = new EFDbContext();
        protected override void Dispose(bool disposing)
        {
            db.Dispose();
            base.Dispose(disposing);
        }
        //
        // GET: /Example/UserInfo/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Reg()
        {
            UserInfo_Reg model = new UserInfo_Reg();
            return View(model);
        }
        [HttpPost]
        public ActionResult Reg(UserInfo_Reg model)
        {
            if (ModelState.IsValid)
            {
                return Content("aaaaaa");
            }
            return View();
        }
        //验证是否存在此账号
        [HttpGet]
        public ActionResult UserExists(string userName)
        {
            bool exists = true;
            
            return Json(!exists, JsonRequestBehavior.AllowGet);
        }

    }
}
